package com.googlecode.vmock;

/**
 * A call result that is expected to return a value.
 * 
 * @author marcin.jagus
 */
class ReturnCallResult extends AbstractExpectedCallResult {

    /**
     * A value that is expected to be returned.
     */
    private Object returnValue;

    /**
     * Creates new result for a given call with a given return value.
     * 
     * @param returnValue Given return value
     * @param recordedCall Given recorded call
     */
    public ReturnCallResult(Object returnValue, RecordedCall recordedCall) {
        super(recordedCall);
        this.returnValue = returnValue;
    }

    @Override
    public Object getResult(Object[] params) {
        incrementTimesInvoked();
        return returnValue;
    }

}
